package yxy.game.pm2.bean.reset;

import org.redisson.api.RBucket;
import yxy.apple.util.redisson.RedisException;
import yxy.cherry.game.base.redis.RedisManager;
import yxy.game.pm2.bean.module.BaseGameRedisLockBean;

public class WuchaoClear extends BaseGameRedisLockBean {



    static public String key(String playerCode) {
        return String.format("PLAYER:%s:ISCLEANWUCHAO", playerCode);
    }


    static private RBucket<String> touch(String key) throws RedisException {
        return RedisManager.client(redis()).getBucket(key);
    }


    static public String get(String playerCode) {
        try {
            String key = key(playerCode);
            RBucket<String> bucket = touch(key);
            return bucket.get();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }



    public static void set(String playerCode,String isChangeExperience) {
        try {
            String key = key(playerCode);
            RBucket<String> touch = touch(key);
            touch.set(isChangeExperience);
        } catch (RedisException e) {
            e.printStackTrace();
        }
    }

}
